<template>
	<view class="content">
		<view class="inner">
			<view class="top">拒绝原因</view>
			<view class="bottom">
				<u--textarea border="none" :maxlength="200" count v-model="form.rejectReason" placeholder="请输入拒绝原因"
					:height="200"></u--textarea>
			</view>
		</view>
		<!-- 按钮 -->
		<view class="btn">
			<u-button @click="handleSubmit" type="primary" text="提交"></u-button>
		</view>
	</view>
</template>

<script>
	import {
		getResDetail,
		checkRes
	} from '../../api/reservation.js'
	export default {
		data() {
			return {
				reservationId: "",
				form: {
					rejectReason: "",
					reservationId: ""
				}
			};
		},
		onLoad(options) {
			this.form.reservationId = options.reservationId
			this.form.status = 1

			this.form.checkStatus = 1

		},
		methods: {
			handleSubmit() {
				if (!this.form.rejectReason) {
					uni.$u.toast("请先输入拒绝原因")
					return
				}
				checkRes(this.form).then(res => {
					uni.$u.toast("操作成功！")
					setTimeout(() => {
						uni.navigateBack({
							url: "/subpages/admin_res_manage/admin_res_manage"
						})
					}, 500)
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		width: 100%;
		height: 100vh;
		box-sizing: border-box;
		padding: 20upx;
		padding-top: 72upx;

		.inner {
			width: 100%;
			min-height: 48vh;
			background-color: #fff;
			box-shadow: 0 0 10px rgba(0, 0, 0, .15);
			border-radius: 15upx;

			.top {
				box-sizing: border-box;
				padding: 0 20upx;
				width: 100%;
				height: 95upx;
				font-size: 35upx;
				font-weight: 700;
				border-bottom: 3upx solid #f1f1f1;
				line-height: 95upx;
			}

			.bottom {
				width: 100%;
			}
		}

		.btn {
			width: 100%;
			height: 50upx;
			margin-top: 30upx;
		}
	}
</style>